﻿/**
  KCAKCAK   CAKCAKC   AK      CA
 AK        KC     CA  AK    AK
CA         KC     CA  AK  KC
CA         KCAKCAKCA  AKCA
CA         KC     CA  AK  KC
 AK        KC     CA  AK    AK
  KCAKCAK  KC     CA  AK      CA

_________________________________________________________________
 China ataca Kamchatka - copyright 2007(c) Ruben Sainz de la Maza
 
	@class: 	Round
	@vertion: 	0.1
	@date:		28/11/07
				
	@language: 	ActionScript 3.0
	@author:	Ruben Sainz de la Maza
	@usage: 
		var objRound:Round = new Round("Ruben", "Negro");
		_objRounds[pName] = objRound;				
		trace(_objRounds.Ruben.pName);
		trace(_objRounds.Ruben.pColor); 
		
**/

package com.conelmate.cak.game.rounds
{
	
	import com.conelmate.util.Trace;
	
	
	public class Round extends Trace implements IRound
	{
		
		private var _objRSM			:RoundStateMachine;	//ref a la maquina de estados
		
		private var	_isFreeze		:Boolean = false;		//true:congela eventos, false:reactiva eventos
		
		private	var	_strName		:String;				//nombre del jugador
		private	var	_strColor		:String;				//color. Posiblidaddes: AZUL NEGRO ROJO BLANCO VERDE AMARILLO
		
		private	var	_intObjective	:Number;				//id del objetivo a cumplir
		private	var	_intForces		:Number;				//cantidad de ejercitos
		
		private	var	_objCountries	:Object;				//paises
		private	var	_objCards		:Object;				//tarjetas del jugador, acumuladas en cada ronda
		


//_________________________________________________________________________________ Constructor
		public function Round(pName:String = null)
		{
			_isTrace = true;
			mTrace("#Round# constructor");
			
			if(pName 	!= null) _strName  = pName;
			
			_objRSM = new RoundStateMachine();
			_objRSM.init();
		
			//Setear el estado del jugador: INITIALIZE ACTION REORGANIZE STANDBY(default)
		//	_objRSM.state = RoundStateMachine.INITIALIZE;
		//	_objRSM.state = RoundStateMachine.ACTION;
		//	_objRSM.state = RoundStateMachine.REORGANIZE;
		//	_objRSM.state = RoundStateMachine.STANDBY;
		}
		

//_________________________________________________________________________________ Public Methods

		/**
		 * Inicializa la clase
		 */
		public function init():void
		{
			mTrace("#Round " + _objRSM.state + "# init");
		}
		

		/**
		 * Destruye las instancias
		 */
		public function destroy():void
		{
			mTrace("#Round " + _objRSM.state + "# destroy");
		}
		
		
		/**
		 * Congela / descongela los eventos de la clase
		 * @param   freeze 
		 */		
		public function freeze(freeze:Boolean):void
		{
			mTrace("#Round " + _objRSM.state + "# freeze");
			_isFreeze = freeze;
		}
		

//_________________________________________________________________________________ Private Methods




//_________________________________________________________________________________ GETTERS

		public function get pName()			:String	{ return _strName; }

//_________________________________________________________________________________ SETTERS	

		public function set pName			(p:String)	{ _strName = p; }

	}
}